# -*- coding: utf-8 -*-
"""
-------------------------------------------------
Project Name: luffcity study project
File Name: client_db.py
Author: kij
Create Date: 2021/3/8
-------------------------------------------------
"""
import pymysql



# 建立链接
conn = pymysql.connect(
	host='39.98.160.25',
	port=3306,
	user='kij',
	password='123123',
	db='luffy',
	charset='utf8')

# 游标
course = conn.cursor()
# 执行sql语句

sql = 'select * from class'
rows = course.execute(sql)
# for item in range(rows):
# 	print(course.fetchone())
# print(course.fetchmany(2))
print(course.fetchall())
course.close()
conn.close()
print('链接数据库')
print(rows)

